﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class DeliverGoodsManagement_DealLogList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            AspNetPager1.PageSize = Convert.ToInt32(ConfigurationManager.AppSettings["RowCountPerPage"].ToString());
            BindRepeater();
        }
    }

    private void BindRepeater()
    {
        int recordCount;
        rptIMPORTBILL.DataSource = new BLL.IMPORTBILL().SP_DealLog_GetDealLog(GetStartIndex(AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize), AspNetPager1.PageSize, "", out recordCount);
        rptIMPORTBILL.DataBind();
        AspNetPager1.RecordCount = recordCount;
    }
    private int GetStartIndex(int pageIndex, int pageSize)
    {
        return 1 + (pageIndex - 1) * pageSize;
    }

    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        BindRepeater();
    }
    protected void btnImport_Click(object sender, EventArgs e)
    {
        if (!Check.CheckPermission("700101", "00022"))
        {
            Share.Alert(this.Page, "无权操作"); return;
        }
        Response.Redirect("importwindow.aspx");
    }
}
